package exsun.jt808.data.jt809_data;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Objects;

@Data
public class BasicVehicleInfo implements Serializable {

    /**
     * 车牌号
     */
    public String vehicleNo;

    /**
     * 车牌颜色
     */
    public int vehicleColor;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BasicVehicleInfo that = (BasicVehicleInfo) o;
        return vehicleColor == that.vehicleColor &&
                Objects.equals(vehicleNo, that.vehicleNo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(vehicleNo, vehicleColor);
    }

    public JSONObject toJSONString() {
        JSONObject object = new JSONObject();
        object.put("vehicleNo", vehicleNo);
        object.put("vehicleColor", vehicleColor);
        return object;
    }
}
